package implementation;

import model.HasSource;
import model.Operation;
import operand.MyValue;
import operand.Operand;


/**
 * The {@link IntegerAddition} is the multiplication {@link Operation} on the data type {@link Integer}.
 *
 */
public class IntegerMultiplication extends Operation<Integer>{

	/**
	 * Constructor of {@link IntegerMultiplication}.
	 * @param factor1 is the first factor.
	 * @param factori2 is the second factor.
	 */
	public IntegerMultiplication(
			final HasSource<Operand<Integer>> factor1,
			final HasSource<Operand<Integer>> factor2) {
		super(factor1, factor2);
	}

	@Override
	protected Operand<Integer> calculateTransitive(final MyValue<Integer> firstValue,
			final MyValue<Integer> secondValue) {
		return new MyValue<Integer>(firstValue.getValue() * secondValue.getValue());
	}
}
